﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.ServiceModel;
using CPAScoringPerformanceTester.Models;

namespace CPAScoringPerformanceTester.TestTask
{
    class ServiceConnectionTask : TestTaskBase
    {
        public static string TaskName = "Service Connection Test";

        public ServiceConnectionTask()
        {
            
        }

        public override bool Execute()
        {
            try
            {
                Client = ServiceProxy.NewProxy();
                return Client.TestConnection();
            }
            catch (Exception ex)
            {
                Message = ex.Message;
                return false;
            }
            finally
            {
                Client.CloseConnection();
            }
        }
    }
}
